#ifndef INDEX_H
#define INDEX_H

#include <QWidget>
#include <QGraphicsDropShadowEffect>
#include <QMouseEvent>
#include "settings.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Index; }
QT_END_NAMESPACE

class Index : public QWidget
{
    Q_OBJECT

public:
    Index(QWidget *parent = nullptr);
    ~Index();
    void SetShadow(bool shad);
    QGraphicsDropShadowEffect *shadow_effect;
    QGraphicsDropShadowEffect *shadow_catear_l;
    QGraphicsDropShadowEffect *shadow_catear_r;
protected:
    void mouseMoveEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);


private slots:
    void on_closeButton_clicked();
    void on_changeSizeButton_clicked();
    void on_minimizeButton_clicked();
private:
    QPoint mousePoint;
    bool mouse_press;
    void createShadow();
    void ResizeCatEar(int w = 200, int h = 212);
    Ui::Index *ui;
    QRect defaultSize;
};
#endif // INDEX_H
